//
//  QiMingADXKitLogging.h
//  QiMingADXSDK
//
//  Created by Jiangyou on 2022/10/11.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, QiMingADXKitLogLevel) {
    /// No logs
    QiMingADXKitLogLevelOff     = 0,
    /// Error logs only. 0...00001
    QiMingADXKitLogLevelError   = (1 << 0),
    /// Error and warning logs, 0...00010
    QiMingADXKitLogLevelWarning = (1 << 1),
    /// Error, warning and info logs, 0...00100
    QiMingADXKitLogLevelInfo    = (1 << 2),
    /// Error, warning, info and debug logs, 0...01000
    QiMingADXKitLogLevelDebug   = (1 << 3),
    /// Error, warning, info, debug and verbose logs, 0...10000
    QiMingADXKitLogLevelVerbose = (1 << 4),
    /// All logs. 1...11111
    QiMingADXKitLogLevelAll     = NSUIntegerMax
};

QiMingADXKitLogLevel QiMingADXKitLogGetLevel(void);
void QiMingADXKitLogSetLevel(QiMingADXKitLogLevel level);

FOUNDATION_EXPORT void _QiMingADXKitLogError(NSString *format, ...);
FOUNDATION_EXPORT void _QiMingADXKitLogWarn(NSString *format, ...);
FOUNDATION_EXPORT void _QiMingADXKitLogInfo(NSString *format, ...);
FOUNDATION_EXPORT void _QiMingADXKitLogDebug(NSString *format, ...);
FOUNDATION_EXPORT void _QiMingADXKitLogVerbose(NSString *format, ...);

#ifdef DEBUG
    #define QiMingADXKitLogError(...)   _QiMingADXKitLogError(__VA_ARGS__)
    #define QiMingADXKitLogWarn(...)    _QiMingADXKitLogWarn(__VA_ARGS__)
    #define QiMingADXKitLogInfo(...)    _QiMingADXKitLogInfo(__VA_ARGS__)
    #define QiMingADXKitLogDebug(...)   _QiMingADXKitLogDebug(__VA_ARGS__)
    #define QiMingADXKitLogVerbose(...) _QiMingADXKitLogVerbose(__VA_ARGS__)
#else
    #define QiMingADXKitLogError(...)   _QiMingADXKitLogError(__VA_ARGS__)
    #define QiMingADXKitLogWarn(...)    _QiMingADXKitLogWarn(__VA_ARGS__)
    #define QiMingADXKitLogInfo(...)    _QiMingADXKitLogInfo(__VA_ARGS__)
    #define QiMingADXKitLogDebug(...)   _QiMingADXKitLogDebug(__VA_ARGS__)
    #define QiMingADXKitLogVerbose(...) {}
#endif
